/**
  @file     	DESIGNPATTERN_FlyweightFactory.h 
  @brief    	Define an interface for creating an object, and the package object is created
  @author  	arvin
  @version 	1.0   2012/12/13
 */

#ifndef CXX_DESIGNPATTERN_FLYWEIGHTFACTORY_H
#define CXX_DESIGNPATTERN_FLYWEIGHTFACTORY_H
#include <list>

using namespace std;

class Flyweight;

class FlyweightFactory
{
public:
	/**
	* Destruction
	*
	* @param VOID
	* @return 
	*/
	~FlyweightFactory();

	/**
	* Instance
	*
	* @param VOID
	* @return FlyweightFactory*
	* @note singleton
	*/
	static FlyweightFactory* Instance();
	
	/**
	* Destroy
	*
	* @param VOID
	* @return VOID
	* @note singleton
	*/
	static VOID Destroy();

	/**
	* Create Flyweight
	*
	* @param const string& key
	* @return Flyweight* 
	*/
	Flyweight* CreateFlyweight(const string& key);
protected:
private:
	/**
	* Construction
	*
	* @param VOID
	* @return 
	*/
	FlyweightFactory();

	/**
	* Copy Construction
	*
	* @param const FlyweightFactory& cFlyweightFactory
	* @return 
	*/
	FlyweightFactory(const FlyweightFactory& cFlyweightFactory);

	/**
	* Assignment
	*
	* @param const FlyweightFactory& cFlyweightFactory
	* @return FlyweightFactory&
	*/
	FlyweightFactory& operator=(const FlyweightFactory& cFlyweightFactory);

public:
protected:
private:
	static FlyweightFactory* m_pInstance;
	list<Flyweight*> m_listFlyweight;
};
#endif	/* >>CXX_DESIGNPATTERN_FLYWEIGHTFACTORY_H<< */
/* EOF */